package com.fhzn.auth.enums;

import lombok.Getter;

/**
 * @author fhzn
 */
@Getter
public enum DataResourceTypeEnum {

    /**
     * 主体
     */
    COMPANY(1, "主体"),

    /**
     * 账户
     */
    ACCOUNT(2, "账户"),

    ;


    private final int type;

    private final String name;

    DataResourceTypeEnum(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public static DataResourceTypeEnum getByType(int type) {
        for (DataResourceTypeEnum tmp : DataResourceTypeEnum.values()) {
            if (tmp.getType() == type) {
                return tmp;
            }
        }
        return null;
    }


}
